package com.example.demo.Mapper;

import com.example.demo.pojo.Role;
import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where  username=#{username}")
    User findByUsername(String username);

    @Select("select * from user_role where user_id=#{id}")
    List<Integer> listRoleIds(Integer id);

    @Select("select * from role where id=#{roleId}")
    Role listRole(Integer roleId);
}
